<?php

/**
 * ScoutTemplate filter form base class.
 *
 * @package    aiontoolskit
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseScoutTemplateFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'lvl'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'maxHp'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'maxMp'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'power'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'health'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'agility'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'accuracy'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'knowledge'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'will'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'walk_speed'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'run_speed'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'fly_speed'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'attack_speed'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'evasion'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'block'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'parry'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'main_hand_attack'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'main_hand_accuracy'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'main_hand_crit_rate' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'magic_accuracy'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'lvl'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'maxHp'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'maxMp'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'power'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'health'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'agility'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'accuracy'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'knowledge'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'will'                => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'walk_speed'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'run_speed'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'fly_speed'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'attack_speed'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'evasion'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'block'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'parry'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'main_hand_attack'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'main_hand_accuracy'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'main_hand_crit_rate' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'magic_accuracy'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('scout_template_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ScoutTemplate';
  }

  public function getFields()
  {
    return array(
      'id'                  => 'Number',
      'lvl'                 => 'Number',
      'maxHp'               => 'Number',
      'maxMp'               => 'Number',
      'power'               => 'Number',
      'health'              => 'Number',
      'agility'             => 'Number',
      'accuracy'            => 'Number',
      'knowledge'           => 'Number',
      'will'                => 'Number',
      'walk_speed'          => 'Number',
      'run_speed'           => 'Number',
      'fly_speed'           => 'Number',
      'attack_speed'        => 'Number',
      'evasion'             => 'Number',
      'block'               => 'Number',
      'parry'               => 'Number',
      'main_hand_attack'    => 'Number',
      'main_hand_accuracy'  => 'Number',
      'main_hand_crit_rate' => 'Number',
      'magic_accuracy'      => 'Number',
    );
  }
}
